package TomcatClient;

import org.junit.Test;

import java.io.IOException;
import java.net.Socket;
import java.util.Date;

public class sendHtml {
    public void sendHtml(String html, Socket socket) {
        final Date date = new Date();
        String head = "HTTP/1.1 200 ok" + "\n" + "Date: " + date.toString() + "\n" + "Content-Type: text/html;charset=ISO-8859-1\n" + "\n" + "\n";
         head += html;
        try {
            socket.getOutputStream().write(head.getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
